<?php $this->action("index","more","header");?>
       <script>
Do(function(){
	
		
	  	$(".UIMG").each(function(i){
	  		
	   		getImageInfo(this);
	   		
		 });
		function getImageInfo(obj)
		{	
			
			var img = new Image();
			img.src = $(obj).attr("isrc");
			
			if (img.complete) { 
		        callback.call(img, obj);
		        return; 
		    }
			img.onload = function(){ 
		  		callback.call(img, obj);
		   
			};
			img.onerror = function()
			{
		
				obj.src='/pics/blank.gif';
				obj.width=0;
				obj.height=0;
		
			}
		}
		
		
		function callback(obj)
		{
			
			   var  nWidth = $(obj).attr("iw");
			   var  nHeight = $(obj).attr("ih");
			  
		       var w , h , p1 , p2 ;
		       //计算宽和高的比例
		       if(this.width > nWidth)
		       {
			       p1 = nWidth / nHeight ;
			       p2 = this.width / this.height ;
					
			       w = 0 ; h = 0 ;
			       if( p1 < p2 )
			       {
			           //按宽度来计算新图片的宽和高
			           w = nWidth ;
			           h = nWidth * ( 1 / p2 ) ;
			       }
			       else
			       {
			           //按高度来计算新图片的宽和高
			           h = nHeight ;
			           w = nHeight * p2 ;
			       }
		     	}
		     	else
		     	{
		     		w = this.widht;
		     		h = this.height;
		     	}
			obj.src = this.src;
			obj.widht= w;
			obj.height=h;
		} 
		 
});
function reply(id) 
{ 

	$("#fid").val(id);
	$("#cancel-comment-reply-link").show();
	document.location='#'+document.anchors[0].name; 
	

} 
function noreply()
{
	$("#fid").val(0);
	$("#cancel-comment-reply-link").hide();
}
function check()
{
		
	
	    var content = $("#ke_content").val();
		if(content.trim() == "")
		{
		
			alert("回应内容不能为空");
			return false ;
		}
		return true;
}	    

</script>
        <div id="content">
            <div class="main">
      
        


                
    <h1><?php echo $forum_E->title;?></h1>

                
                
                
<div class="mod">
  <div class="bd">










<div class="post">
<div class="post-author">
<a href="http://t.sina.com.cn/<?php echo $forum_E->mapUser->getUid();?>"><img src="<?php echo $forum_E->mapUser->getImage();?>" class="pil"></a>
</div>

<div class="post-content">
  <div class="post-info">
    <span class="datetime"><?php echo $forum_E->getCtime('Y-m-d h:i');?></span>
    <span class="from">来自: <a href="http://t.sina.com.cn/<?php echo $forum_E->mapUser->uid;?>"><?php echo $forum_E->mapUser->getName();?> </a></span>
  </div>

<p><?php echo $forum_E->getContent();?></p>
<?php if($RootOper == 1){?>
<div class="post-func">


    <a href="<?php echo $this->getUrl("index","mod","modifyforum",array('siteid'=>$site_E->id,'modid'=>$mod_E->id,'forumid'=>$forum_E->id));?>" rel="nofollow">&gt; 修改　</a>

    <a id="forum-del" href="#" rel="nofollow">&gt; 删除　</a>




</div>
<?php }?>
<script>
Do('dialog', function () {
  $(function () {
  var    delUrl = '<?php echo $this->getUrl("index","mod","removeforum",array('siteid'=>$site_E->id,'modid'=>$mod_E->id,'forumid'=>$forum_E->id));?>';
  var    dlg = dui.Dialog(),
  		 forumDelBn = $('#forum-del');
  		
  		
  		  forumDelBn.click(function (e) {
            e.preventDefault();
            var site_id = $('body').attr('id'); //修改
       	    var room_id = $('body').attr('rid'); //修改
                dlg.set({
                    width: 300,
                    content: '确定要删除？',
                    buttons: [{
                        text: '确定',
                        method: function (o) {
                            o.close();
                        	 $.post(
                                delUrl, 
                                function (me) {
                                    // back to home
                                    if(me.error)
                                    {
                                    	 dlg.set({
							                    width: 300,
							                    content: me.error,
							                    buttons: ['confirm']
							                }).open();
                                    }
                                    else
                                    {
                                   		location.href = '/site/' + site_id + '/' + room_id;
                                   	}
                                },
                                'json'
                            );
                        }
                    }, 'cancel']
                }).open();
                
               });
           
        });
  		
  });


</script>
</div>
</div>


<div class="post-comments">
    

<ol class="commentlist">
<?php echo $this->_helper->Helper_Comment_Tree->getTree($comment_ES);?>
</ol>






    



    












        
    <h2>
        <span>你的回应</span>


        <span class="pl">
        <a name="reply"></a>
        <a id="cancel-comment-reply-link" href="javascript:noreply()" style="display: none;"><font color="red">点击这里取消回复</font></a>
        </span>


    </h2>

        <div id="add_comment" class="comment-form">
        <form action="" method="post" >
          <div class="item">
            <textarea cols="64" rows="8" id="ke_content" name="comment"></textarea><br>
          </div>
          	<input  type="hidden" name="forumid" value="<?php echo $forum_E->id;?>">
            <input id="fid" type="hidden" name="fid" value="0">
             <input type="hidden" name="update" value="1">
            <div class="item">
              <span class="bn-flat-hot"><input type="submit" onclick="return check();" value="加上去"></span>
            </div>
        </form></div>


 

 

    
    
    









</div>









  </div>
</div>
            </div>
            <div class="aside">
                


            </div>
        
        </div>
  <?php $this->partial("/Tpl/Index/MoreAction/doFooter.htm");?>     
    
</body>
</html>























